package com.esri.core.geometry;

import com.esri.core.internal.geometry.ConversionType;
import java.util.Arrays;
import java.util.List;

/* loaded from: classes.dex */
public class CoordinateConversion {

    /* loaded from: classes.dex */
    public enum GARSConversionMode {
        LOWER_LEFT(0),
        CENTRE(1);
        
        private int a;

        GARSConversionMode(int i) {
        }

        int a() {
            return this.a;
        }
    }

    /* loaded from: classes.dex */
    public enum UTMConversionMode {
        DEFAULT(0),
        NORTH_SOUTH_LATITUDE_INDICATORS(1);
        
        private int a;

        UTMConversionMode(int i) {
        }

        int a() {
            return this.a;
        }
    }

    /* loaded from: classes.dex */
    public enum MGRSConversionMode {
        AUTO(0),
        NEW_STYLE(256),
        OLD_STYLE(512),
        NEW_180_IN_ZONE1(4352),
        OLD_180_IN_ZONE1(4608);
        
        private int a;

        MGRSConversionMode(int i) {
        }

        int a() {
            return this.a;
        }
    }

    public static Point decimalDegreesToPoint(String str, SpatialReference spatialReference) {
        return (Point) a(decimalDegreesToPoints(Arrays.asList(str), spatialReference));
    }

    public static List<Point> decimalDegreesToPoints(List<String> list, SpatialReference spatialReference) {
        return SpatialReference.a(list, spatialReference, ConversionType.DECIMAL_DEGREES_TO_POINTS, -1);
    }

    public static String pointToDecimalDegrees(Point point, SpatialReference spatialReference, int i) {
        return (String) a(pointsToDecimalDegrees(Arrays.asList(point), spatialReference, i));
    }

    public static List<String> pointsToDecimalDegrees(List<Point> list, SpatialReference spatialReference, int i) {
        return SpatialReference.a(list, spatialReference, ConversionType.POINTS_TO_DECIMAL_DEGREES, -1, i, false, false);
    }

    public static Point degreesDecimalMinutesToPoint(String str, SpatialReference spatialReference) {
        return (Point) a(degreesDecimalMinutesToPoints(Arrays.asList(str), spatialReference));
    }

    public static List<Point> degreesDecimalMinutesToPoints(List<String> list, SpatialReference spatialReference) {
        return SpatialReference.a(list, spatialReference, ConversionType.DEGREES_DECIMAL_MINUTES_TO_POINTS, -1);
    }

    public static List<String> pointsToDegreesDecimalMinutes(List<Point> list, SpatialReference spatialReference, int i) {
        return SpatialReference.a(list, spatialReference, ConversionType.POINTS_TO_DEGREES_DECIMAL_MINUTES, -1, i, false, false);
    }

    public static String pointToDegreesDecimalMinutes(Point point, SpatialReference spatialReference, int i) {
        return (String) a(pointsToDegreesDecimalMinutes(Arrays.asList(point), spatialReference, i));
    }

    public static Point degreesMinutesSecondsToPoint(String str, SpatialReference spatialReference) {
        return (Point) a(degreesMinutesSecondsToPoints(Arrays.asList(str), spatialReference));
    }

    public static List<Point> degreesMinutesSecondsToPoints(List<String> list, SpatialReference spatialReference) {
        return SpatialReference.a(list, spatialReference, ConversionType.DEGREES_MINUTUES_SECONDS_TO_POINT, -1);
    }

    public static List<String> pointsToDegreesMinutesSeconds(List<Point> list, SpatialReference spatialReference, int i) {
        return SpatialReference.a(list, spatialReference, ConversionType.POINTS_TO_DEGREES_MINUTES_SECONDS, -1, i, false, false);
    }

    public static String pointToDegreesMinutesSeconds(Point point, SpatialReference spatialReference, int i) {
        return (String) a(pointsToDegreesMinutesSeconds(Arrays.asList(point), spatialReference, i));
    }

    public static Point garsToPoint(String str, SpatialReference spatialReference, GARSConversionMode gARSConversionMode) {
        return (Point) a(garsToPoints(Arrays.asList(str), spatialReference, gARSConversionMode));
    }

    public static List<Point> garsToPoints(List<String> list, SpatialReference spatialReference, GARSConversionMode gARSConversionMode) {
        return SpatialReference.a(list, spatialReference, ConversionType.GARS_TO_POINTS, gARSConversionMode.a());
    }

    public static List<String> pointsToGars(List<Point> list, SpatialReference spatialReference) {
        return SpatialReference.a(list, spatialReference, ConversionType.POINTS_TO_GARS, -1, -1, false, false);
    }

    public static String pointToGars(Point point, SpatialReference spatialReference) {
        return (String) a(pointsToGars(Arrays.asList(point), spatialReference));
    }

    public static List<Point> georefToPoints(List<String> list, SpatialReference spatialReference) {
        return SpatialReference.a(list, spatialReference, ConversionType.GEOREF_TO_POINTS, -1);
    }

    public static Point georefToPoint(String str, SpatialReference spatialReference) {
        return (Point) a(georefToPoints(Arrays.asList(str), spatialReference));
    }

    public static List<String> pointsToGeoref(List<Point> list, SpatialReference spatialReference, int i, boolean z) {
        return SpatialReference.a(list, spatialReference, ConversionType.POINTS_TO_GEOREF, -1, i, z, false);
    }

    public static String pointToGeoref(Point point, SpatialReference spatialReference, int i, boolean z) {
        return (String) a(pointsToGeoref(Arrays.asList(point), spatialReference, i, z));
    }

    public static List<Point> mgrsToPoints(List<String> list, SpatialReference spatialReference, MGRSConversionMode mGRSConversionMode) {
        return SpatialReference.a(list, spatialReference, ConversionType.MGRS_TO_POINTS, mGRSConversionMode.a());
    }

    public static Point mgrsToPoint(String str, SpatialReference spatialReference, MGRSConversionMode mGRSConversionMode) {
        return (Point) a(mgrsToPoints(Arrays.asList(str), spatialReference, mGRSConversionMode));
    }

    public static List<String> pointsToMgrs(List<Point> list, SpatialReference spatialReference, MGRSConversionMode mGRSConversionMode, int i, boolean z, boolean z2) {
        return SpatialReference.a(list, spatialReference, ConversionType.POINTS_TO_MGRS, mGRSConversionMode.a(), i, z, z2);
    }

    public static String pointToMgrs(Point point, SpatialReference spatialReference, MGRSConversionMode mGRSConversionMode, int i, boolean z, boolean z2) {
        return (String) a(pointsToMgrs(Arrays.asList(point), spatialReference, mGRSConversionMode, i, z, z2));
    }

    public static Point usngToPoint(String str, SpatialReference spatialReference) {
        return (Point) a(usngToPoints(Arrays.asList(str), spatialReference));
    }

    public static List<Point> usngToPoints(List<String> list, SpatialReference spatialReference) {
        return SpatialReference.a(list, spatialReference, ConversionType.USNG_TO_POINTS, -1);
    }

    public static List<String> pointsToUsng(List<Point> list, SpatialReference spatialReference, int i, boolean z, boolean z2) {
        return SpatialReference.a(list, spatialReference, ConversionType.POINTS_TO_USNG, -1, i, z, z2);
    }

    public static String pointToUsng(Point point, SpatialReference spatialReference, int i, boolean z, boolean z2) {
        return (String) a(pointsToUsng(Arrays.asList(point), spatialReference, i, z, z2));
    }

    public static List<Point> utmToPoints(List<String> list, SpatialReference spatialReference, UTMConversionMode uTMConversionMode) {
        return SpatialReference.a(list, spatialReference, ConversionType.UTM_TO_POINTS, uTMConversionMode.a());
    }

    public static Point utmToPoint(String str, SpatialReference spatialReference, UTMConversionMode uTMConversionMode) {
        return (Point) a(utmToPoints(Arrays.asList(str), spatialReference, uTMConversionMode));
    }

    public static List<String> pointsToUtm(List<Point> list, SpatialReference spatialReference, UTMConversionMode uTMConversionMode, boolean z) {
        return SpatialReference.a(list, spatialReference, ConversionType.POINTS_TO_UTM, uTMConversionMode.a(), -1, false, z);
    }

    public static String pointToUtm(Point point, SpatialReference spatialReference, UTMConversionMode uTMConversionMode, boolean z) {
        return (String) a(pointsToUtm(Arrays.asList(point), spatialReference, uTMConversionMode, z));
    }

    private static <T> T a(List<T> list) {
        if (list == null || list.isEmpty()) {
            return null;
        }
        return list.get(0);
    }
}
